package cn.com.iswl.soap.service.impl;

import javax.jws.WebService;

import org.springframework.beans.factory.annotation.Autowired;

import cn.com.iswl.soap.entity.User;
import cn.com.iswl.soap.repository.UserRepository;
import cn.com.iswl.soap.service.UserService;

@WebService(name = "UserService", targetNamespace = "http://service.soap.iswl.com.cn/", endpointInterface = "cn.com.iswl.soap.service.UserService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public String getName(String userId) {
        User findOne = userRepository.findOne(userId);
        return findOne.getUsername();
    }

    @Override
    public User getUser(String userId) {
        return userRepository.findOne(userId);
    }

}
